package com.composite.demo2.abs;

import java.util.Iterator;

public abstract class MenuComponent {

	public void add(MenuComponent menuComponent) {
		throw new UnsupportedOperationException();
	}

	public void remove(MenuComponent menuComponent) {
		throw new UnsupportedOperationException();
	}

	public MenuComponent getChild(int i) {
		throw new UnsupportedOperationException();
	}

	public String getName() {
		throw new UnsupportedOperationException();
	}

	public String getDescription() {
		throw new UnsupportedOperationException();
	}

	public double getPrice() {
		throw new UnsupportedOperationException();
	}

	public boolean isVegetarian() {
		throw new UnsupportedOperationException();
	}

	/**
	 * 加入createIterator方法，这意味着，每个菜单和菜单项都必须实现这个方法。也意味着，对一个组合调用createIterator方法，
	 * 将会应用于该组合的所有孩子
	 * 
	 * @return
	 */
	public abstract Iterator<MenuComponent> createIterator();

	public void print() {
		throw new UnsupportedOperationException();
	}

}
